package com.umeox.watch.moto.settings.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

public class CustomScrollView extends ScrollView {
    public CustomScrollView(Context context) {
        this(context, null);
    }

    public CustomScrollView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public CustomScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if (mScrollChangedListener!=null){
            mScrollChangedListener.onScrollChanged(l, t, oldl, oldt);
        }
    }

    public void setScrollChangedListener(ScrollChangedListener scrollChangedListener) {
        mScrollChangedListener = scrollChangedListener;
    }

    private ScrollChangedListener mScrollChangedListener;

   public interface ScrollChangedListener {

        void onScrollChanged(int l, int t, int oldl, int oldt);
    }
}
